<?php
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $content string 字符串 */


$web = Url::to("@web");

?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>产品分类</title>
    <link type="text/css" href="<?= $web ?>/css/wx-good/goods-category.css" rel="stylesheet"/>
    <link type="text/css" href="<?= $web ?>/css/global.css" rel="stylesheet"/>
    <script type="text/javascript" src="<?= $web ?>/js/jquery.js"></script>
    <?php     require_once Yii::$app->viewPath.'/wx-no-share.php'  ?>
    <script type="text/javascript">
        $(document).ready(function () {
            var w = $(document).width();
            if (w > 640) {
                w = 640;
            }
            $("html").css("font-size", w * 20 / 320);

        });

        function href_goods_query(categoryStr) {
            categoryStr = encodeURI(categoryStr);
            window.location.href = "<?=Url::to(["wx-good/goods-query"]);?>?category=" + categoryStr;
        }
    </script>
</head>
<body>

<div class="main" style="width: 16rem; margin: 0 auto;">
    <div class="list" onclick="href_goods_query('0');">
        <div class="list-left">全部分类</div>
        <div class="list-right">
            <img src="<?= $web ?>/img/wx-good/order-2.png"
                 style="width: 0.6rem; height: 0.8rem; display: inline-block; margin-top: 0.1rem;margin-left: 0.4rem">
        </div>
    </div>
    <?php
    foreach ($categoryList as &$category) {
        ?>
        <div class="list" onclick="href_goods_query('<?= $category['NAME'] ?>');">
            <div class="list-left"><?= $category['NAME'] ?></div>
            <div class="list-right">
                <img src="<?= $web ?>/img/wx-good/order-2.png"
                     style="width: 0.6rem; height: 0.8rem; display: inline-block; margin-top: 0.1rem;margin-left: 0.4rem">
            </div>
        </div>

        <?php
    }
    ?>
</div>

</body>
</html>

